functions.js ➔ ... ➔ xobj.onreadystatechange   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 1
b 0
f 0
cc 3
nc 2
nop 0
1
function loadJSON(filename, callback)
2
{
3
4
    var xobj = new XMLHttpRequest();
5
    xobj.overrideMimeType("application/json");
6
    xobj.open('GET', filename, true);
7
    xobj.onreadystatechange = function () {
8
        if (xobj.readyState == 4 && xobj.status == "200") {
9
            // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
10
            callback(xobj.responseText);
11
        }
12
    };
13
    xobj.send(null);
14
}
15
16
17
function equalsHeightOf(node1, node2)
18
{
19
    var w1 = node1.style.height;
20
    node2.style.height = w1 + 'px';
21
22
}